package com.happy.admin.controller;

import com.happy.film.entity.dto.FilmDto;
import com.happy.film.entity.vo.FilmVo;
import com.happy.film.entity.vo.PageVo;
import com.happy.film.entity.vo.Result;
import com.happy.film.service.IFilmService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * \* User: wei.zhang
 * \* Date: 2020/3/18 18:35
 * \* Description:
 *
 * @author wei.zhang
 * \
 */
@RestController
@RequestMapping("/api/file")
public class FilmController {

    @Autowired
    private IFilmService filmService;

    @ApiOperation("查询电影")
    @PostMapping("/search")
    public Result search(@RequestBody FilmDto filmDto){
        PageVo pageVo = filmService.search(filmDto);
        return Result.data(pageVo);
    }

    @ApiOperation("展示电影")
    @PostMapping("/list")
    public Result list(@RequestBody FilmDto filmDto){
        PageVo pageVo = filmService.listFilms(filmDto);
        return null;
    }

    @ApiOperation("查询电影")
    @PostMapping("/info")
    public Result info(@RequestBody FilmDto filmDto){
        FilmVo filmVo = filmService.info(filmDto.getFilmId());
        return Result.data(filmVo);
    }

}
